//
//  Fish.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Fish.h"

@implementation Fish

-(id)init
{

    _name = @"shark";
    _color = @"white";
    _heavy = 100;
    [self info];
    return self;

}

-(void)info
{

    NSLog(@"%@ %@ %.2f", _name, _color, _heavy);

}

-(void)swim
{

    NSLog(@"%@特别擅长游泳,尤其是%@色的%@", _name, _color, _name);

}


-(NSString *)name
{
    return _name;
}

-(void)setName:(NSString *)name
{
    _name = name;
}
-(NSString *)color
{
    return _color;
}
- (void)setColor:(NSString *)color
{
    _color = color;
}
- (CGFloat)heavy
{
    return _heavy;
}
- (void)setHeavy:(CGFloat)heavy
{
    _heavy = heavy;
}
- (id)initWithName:(NSString *)name color:(NSString *)color heavy:(CGFloat)heavy
{
    _name = name;
    _color = color;
    _heavy = heavy;
    return self;
}


+ (id)fishWithName:(NSString *)name color:(NSString *)color heavy:(CGFloat)heavy
{
    Fish *f = [[Fish alloc] initWithName:name color:color heavy:heavy];
    return f;
}





@end
